package com.ywk.effective._8_transitivity;


//传递性
public class Point {
    private int x;
    private int y;

    public Point(int x, int y) {
        this.x = x;
        this.y = y;
    }

    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof Point)) {
            return false;
        }
       /* if (obj == null || this.getClass() != obj.getClass()) {
            return false;
        }*/
        Point p = (Point) obj;
        return p.x == x && p.y == y;
    }
}

